/* 根元素样式 */
body {
  min-width: 400px;
  min-height: 500px;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* 应用容器 */
.app {
  width: 100%;
  min-height: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  margin: 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* 头部样式 */
.header {
  text-align: center;
  position: relative;
}

.header h2 {
  margin: 0;
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 消息提示 */
.message {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
}

.message.success {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.message.info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* 步骤容器 */
.steps-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* 步骤项 */
.step-item {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.step-item:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: rgba(102, 126, 234, 0.2);
}

.step-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.step-header h4 {
  margin: 0;
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.step-actions {
  display: flex;
  gap: 6px;
}

.step-config {
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
}

/* 配置行 */
.config-row {
  margin-bottom: 12px;
}

.config-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  letter-spacing: -0.1px;
}

.config-row input,
.config-row textarea,
.config-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  color: #1a1a1a;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.config-row input:focus,
.config-row textarea:focus,
.config-row select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.config-row input:hover,
.config-row textarea:hover,
.config-row select:hover {
  border-color: rgba(102, 126, 234, 0.3);
}

/* 自定义样式文本框 */
.styles-textarea {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  resize: vertical;
  min-height: 60px;
  background: rgba(248, 250, 252, 0.8) !important;
}

.styles-textarea:focus {
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Monaco Editor 容器样式 */
.monaco-editor-container {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.monaco-editor-container:hover {
  border-color: rgba(102, 126, 234, 0.3);
}

.monaco-editor-container:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.config-row input:hover,
.config-row textarea:hover,
.config-row select:hover {
  border-color: rgba(102, 126, 234, 0.3);
}

.config-row textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

/* 配置行组 */
.config-row-group {
  display: flex;
  gap: 12px;
}

.config-row-group .config-row {
  flex: 1;
}

/* 按钮基础样式 */
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  outline: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(-1px);
  transition: all 0.1s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled::before {
  display: none;
}

/* 主要操作按钮 - 启动 */
.btn-start {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-start:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-start:disabled {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: none;
}

/* 危险操作按钮 - 删除 */
.btn-remove {
  background: transparent;
  color: #ef4444;
  border: none;
  padding: 8px;
  box-shadow: none;
}

.btn-remove:hover {
  background: transparent !important;
  color: #dc2626;
  border: none;
  box-shadow: none !important;
  transform: none !important;
}

/* 底部操作区 */
.bottom-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
}

.bottom-actions::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.btn-add {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

.btn-add:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* 提示信息 */
.tips {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tips p {
  margin: 0 0 6px 0;
}

.tips p:last-child {
  margin-bottom: 0;
}

.tips strong {
  color: #374151;
  font-weight: 600;
}

/* 标签页容器 */
.tabs-container {
  margin-top: 6px;
}

/* 标签页导航 */
.tabs-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0;
  padding-top: 0;
  position: relative;
  border-bottom: 1px solid #e5e7eb;
}

.tabs-nav::-webkit-scrollbar {
  height: 0;
}

/* 标签页 */
.tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.2s ease;
  white-space: nowrap;
  position: relative;
  min-width: auto;
  flex-shrink: 0;
}

.tab:hover {
  color: #374151;
}

.tab.active {
  color: #2563eb;
  font-weight: 600;
  position: relative;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
}



.tab-name {
  font-weight: inherit;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-name-input {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  font-weight: inherit;
  color: inherit;
  max-width: 120px;
  outline: none;
}

.tab-name-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.tab.active .tab-name {
  font-weight: 600;
  color: #2563eb;
}

.tab-count {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  font-weight: 500;
}

.tab.active .tab-count {
  background: #dbeafe;
  color: #2563eb;
}

.tab-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  margin-left: 4px;
  opacity: 0.7;
}

.tab-close:hover {
  color: #ef4444;
  opacity: 1;
}

.tab:hover .tab-close {
  opacity: 1;
}

/* 新建标签按钮 */
.tab-new {
  background: transparent;
  color: #6b7280;
  border: none;
  min-width: 32px;
  max-width: 32px;
  flex-shrink: 0;
  justify-content: center;
  font-size: 18px;
  font-weight: normal;
  padding: 12px 0;
}

.tab-new:hover {
  color: #2563eb;
}



/* 信息类型消息 */
.message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* 加载动画 */
.loading {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
